package com.usian.controller;

import com.usian.feign.TbItemFeign;
import com.usian.utils.CatResult;
import com.usian.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chen
 * @date 2021/1/12 - 10:51 - 星期二
 * @project usian_parent
 * @package com.usian.controller
 * @by GGbomd猪猪侠
 */
@RestController
@RequestMapping("/frontend/itemCategory")
public class ItemCategoryControllerWeb {

    @Autowired
    private TbItemFeign tbItemFeign;

    /**
     * 查询首页商品分类
     * 操作tb_item_cat
     * @return
     */
    @RequestMapping("/selectItemCategoryAll")
    public Result selectItemCategoryAll(){
        CatResult catResult = tbItemFeign.selectItemCategoryAll();
        if (catResult.getData().size() > 0){
            return Result.ok(catResult);
        }
        return Result.error("查无结果");
    }
}
